package com.yaglyf.mvc.service.impl;

import com.yaglyf.mvc.controller.vo.UserRegister;
import com.yaglyf.mvc.emun.UserEnum;
import com.yaglyf.mvc.service.core.intf.IUserInfoService;
import com.yaglyf.mvc.service.itf.IRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Title: Class CommentsShow
 * Description:
 * 注释展示类，说明各种方法注释怎么写
 *
 * @author qiang.yang
 * @version 1.0.0
 * @email qiang.yang@chinaredstar.com
 * @date: 2016/10/16 17:11
 */
@Service
public class RegisterService implements IRegisterService {

    @Autowired
    private IUserInfoService userInfoService;

    @Override
    public UserEnum registerUser(UserRegister userRegister) {
        if (null == userRegister ){
            return UserEnum.REG_ERR;
        }
        UserEnum userEnum;
        try {
            userEnum = userInfoService.userRegister(userRegister).getUserEnum();
        } catch (Exception e) {
            userEnum = UserEnum.REG_ERR;
        }
        return userEnum;
    }
}
